// 相关的依赖
import Vue from 'vue'
import VueRouter from 'vue-router'
import axios from 'axios'
import VueAxios from 'vue-axios'
import { Header, Swipe, SwipeItem, Button } from 'mint-ui'
import routerObj from './router/router.js'

// 相关的css
import './lib/mui/css/mui.min.css'
import './lib/mui/css/icons-extra.css'
import 'mint-ui/lib/style.css'

// 导入自己的组件
import app from './App.vue'

// mui的之间注册
Vue.component(Header.name, Header)
Vue.component(Swipe.name, Swipe)
Vue.component(SwipeItem.name, SwipeItem)
Vue.component(Button.name, Button)

// 使用路由
Vue.use(VueRouter)

// 配置根域名
axios.defaults.baseURL = 'http://localhost:9000/api';
// 将axios挂载到Vue原型上
Vue.use(VueAxios, axios)

// 导入格式化时间的插件
import moment from 'moment'
moment.locale('zh-cn')
Vue.filter('dateFormat', function(dataStr, pattern = 'YYYY-MM-DD HH:mm') {
    return moment(dataStr).format(pattern);
})

Vue.prototype.dateFormat01 = function(dataStr) {
    return moment(dataStr).format('YYYY-MM-DD HH:mm');
}


var vm = new Vue({
    el: '#app',
    data: {},
    methods: {

    },
    render: c => c(app),
    router: routerObj
})